Release 10.1A: OpenEdge Data Management:
DataServer for Microsoft SQL Server


ROWID characteristics

The ROWID value is not stored directly in the MS SQL Server data source, but it is represented by a unique index key in your database. If you migrated your database to an MS SQL Server and elected to use the CREATE RECID FIELD option during the migration, a unique 4-byte Integer column named PROGRESS_RECID and a corresponding seed column named PROGRESS_RECID_IDENT will have been automatically generated in your database tables along with a corresponding Index containing the PROGRESS_RECID value as its key.

Note: While the PROGRESS_RECID_IDENT column is not used to resolve the ROWID value, it is important to recognize the presence of this column for purposes of the following discussion. (This point is especially significant because its physical presence is unknown to the schema holder definition that represents this table to the client.)

Databases that are only pulled from the native environment or are migrated without the CREATE RECID FIELD option must choose a unique index key from each table to represent the Progress recid to support the RECID and ROWID functions, and forward and backward scrolling within their 4GL sessions. Progress will internally map the selected unique key to the Progress RECID and ROWID functions. It is important to note that the unique index key used to derive the Progress ROWID must be a single component index for it to map to the ROWID of a temp-table as described in the following discussion. For more details, see the ROWID function discussion in Chapter 2, " Initial Programming Considerations."

Also, before discussing ROWID as it relates to the RUN STORED-PROC statement, it is important to understand an important property of the Progress ROWID. The "ROWID - Standard Progress 4GL behavior" section presents this information.

ROWID - Standard Progress 4GL behavior

The ROWID value of a temp-table buffer will be different than the ROWID value of a record BUFFER even if the underlying data is identical. This difference exists because the ROWID function relies on the record buffer name.

Example 3–23 shows the standard, expected Progress 4GL behavior.

DEFINE VARIABLE rid-1 AS ROWID. 
DEFINE VARIABLE rid-2 AS ROWID. 
DEFINE TEMP-TABLE ttCust LIKE Sports.Customer 
       FIELD tRecid AS INT 
       FILED tRECID_ident AS INT. 
DEFINE VAR ttHandle AS HANDLE EXTENT 1. 
ttHandle[1]=TEMP-TABLE ttCust:HANDLE. 
FIND FIRST Customer WHERE Customer.custnum=1 NO-LOCK. 
rid-1=ROWID (customer). 
RUN STORED-PROC send-sql-statement 
       LOAD-RESULT-INTO ttHandle (“select * from customer where custnum=1”) 
rid-2=ROWID(ttCust). 
IF rid-1 <> rid-2 THEN MESSAGE “The same record but different ROWID’s”. 

Example 3–23: Expected 4GL behavior - ROWID value of a temp-table buffer

The following sections illustrate the differences between the ROWID value of a temp-table buffer and the ROWID value of a record BUFFER so that you can best understand, program for, and leverage the use of the ROWID function with the LOAD-RESULT-INTO clause of the RUN STORED-PROCEDURE command.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095